
Bullet = class("Bullet");

function Bullet:ctor(firePoint, speed, tag, prefab)
    --self对应的对象的实例本身的表
    self.gameObject = newObject(prefab);
    self.transform = self.gameObject.transform;
    self.gameObject.tag = tag;

    self.transform.position=firePoint.position;
    self.transform.rotation=firePoint.rotation;

    self.rigid = self.gameObject:GetComponent('Rigidbody2D');
    self.rigid.velocity = firePoint.up*speed;

    destroy(self.gameObject, 2);

end
